-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skip empty files in G3Reader #137
Conversation
Avoid throwing an IO error when an empty G3 file is included in the input filenames by silently moving on to the next file in the list until reaching a non-empty file or the end of the list. Fixes #134.
27a73a7
to
684baa8
Compare
Per the comment on the issue, this was a deliberate choice as a way to fail loudly on failed cluster jobs. Can we hide the new behavior behind an option so that people who turn it on are aware of consequences? |
Sure, that's probably a good idea. @samtomguns are you ok with this solution? |
I'll add that the current failure mode is inconsistent -- if the only input file is empty, or just the first file in the list is empty, then the code runs without failure, without this fix. |
is something special about the last file from the perspective of cluster jobs? wouldn't it make more sense to have it fail on every empty file unless some extra option is turned off? |
I think the right solution then is to check whether a file emitted any frames, and raise an error if it didn't (or raise a warning and skip to the next file, if the user sets that option) |
This already fails on the presence of any empty file. We can change the behavior, of course -- I just wanted everyone to be on the same page about why the current behavior exists before we do. |
Sorry, that was wrong. That was what it should have done. Since it isn't, let's just merge the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per comment on issue, what this was supposed to handle was broken to begin with, so this is the closest to existing behavior as it actually is.
Sounds good. As a compromise, I've added an error message for when the reader encounters an empty file. |
Avoid throwing an IO error when an empty G3 file is included in the input filenames by moving on to the next file in the list, until reaching a non-empty file or the end of the list. Issues an error message for every empty file that is encountered.
Fixes #134.